<?php

class Silk_Zgb_Block_Renderer_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
	public function render(Varien_Object $row)
    {
        $product = Mage::getModel('catalog/product')->load($row->getEntityId());
        $cats = $product->getCategoryIds();
        $allCats = '根分类.<br/>全部分类<br/>';
        foreach($cats as $key => $cat)
        {
            if(in_array($cat,array(1,3,12))){
                unset($cat);
            }else{
                $_category = Mage::getModel('catalog/category')->load($cat);
                $allCats.= $_category->getName()."<br/>";  
            }
            
        }
        return $allCats;
    }
}